<?php

$CLPRF2 = '&lt;Sem Incidencias&gt;';

if (isset($_GET['CID'])) {
    $OBJCTCL = $_GET['CID'];
} elseif (isset($_POST['OBJCTCL'])) {
    $OBJCTCL = $_POST['OBJCTCL'];
}

$CLEVENTS = $MYT->db_array("SELECT hc_prfalerts.REF,NAME,Msg FROM hc_prfalerts
				INNER JOIN hcw_alerttypes ON hcw_alerttypes.REF = TYPE
				WHERE RefClient = {$OBJCTCL} AND Status = 2 ORDER BY hc_prfalerts.REF DESC");
for ($e = 1; $e <= $CLEVENTS[0]; $e++) {
    if ($e == 1) {
        $CLPRF2 = $CLEVENTS[$e]['NAME'] . ' - ' . $CLEVENTS[$e]['Msg'];
        $CLREF = $CLEVENTS[$e]['REF'];
    }
}
if (isset($CLREF)) {
    echo '<div id="ClAlertPanel"><font color="#FF0000">' . $CLPRF2 . '</font>
	 | <a onclick="replaceUrl(\'ClAlertPanel\',\'_response/call.php?get=Operative/clientevent&CID=' . $OBJCTCL . '&cAlert_ID=' . $CLREF . '\')">remover</a></div>';
} else {
    echo $CLPRF2;
}
include('viewclientalert.php');